Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@aws-crypto/sha256-js
Advanced tools
The @aws-crypto/sha256-js package is a JavaScript implementation of the SHA-256 hash function. It is part of the AWS SDK for JavaScript and is used to compute SHA-256 cryptographic hash values. This package is particularly useful when working with AWS services that require SHA-256 hashes, such as signing requests for AWS Signature Version 4.
Computing SHA-256 hash
This feature allows you to compute the SHA-256 hash of a given input. The code sample demonstrates how to create a new instance of the Sha256 class, update it with the data to be hashed, and then compute the digest.
const { Sha256 } = require('@aws-crypto/sha256-js');
async function computeHash(data) {
const hash = new Sha256();
hash.update(data);
return hash.digest();
}
computeHash('data to hash').then(console.log);
Crypto-js is a popular package that provides cryptographic functions including SHA-256. It offers a wide range of cryptographic algorithms and is often used for encryption and hashing in JavaScript applications. Compared to @aws-crypto/sha256-js, crypto-js is more general-purpose and not AWS-specific.
js-sha256 is a simple SHA-256 hash function for JavaScript that supports UTF-8 encoding. It is lightweight and has no dependencies. Unlike @aws-crypto/sha256-js, it is not part of the AWS SDK and is designed for general use cases where SHA-256 hashing is needed.
hash.js is a JavaScript hash library that supports several hash functions including SHA-256. It is a pure JavaScript implementation and can be used in various environments. While @aws-crypto/sha256-js is focused on SHA-256 and AWS integration, hash.js provides a broader set of hash functions for different use cases.
A pure JS implementation SHA256.
import {Sha256} from '@aws/crypto-sha256-js';
const hash = new Sha256();
hash.update('some data');
const result = await hash.digest();
npm test
FAQs
A pure JS implementation SHA256.
We found that @aws-crypto/sha256-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.